package ZuoShen;

import java.util.*;

public class Graph {
    public static HashMap<Integer, Node> nodes;
    public static PriorityQueue<Edge> edges;

    public Graph() {
        nodes = new HashMap<>();
        edges = new PriorityQueue<>(Comparator.comparingInt(o -> o.weight));
    }

}

class Edge{
    public Node from, to;
    public int weight;

    public Edge(Node from, Node to, int weight) {
        this.from = from;
        this.to = to;
        this.weight = weight;
    }
}

class Node{
    public int val;
    public ArrayList<Edge> edges;
    public ArrayList<Node> nexts;

    public Node(int val) {
        this.val = val;
        edges = new ArrayList<>();
        nexts = new ArrayList<>();
    }
}
